/**
 *
 * @param {*} data
 * @param msg
 * @param code
 * @returns {{success: boolean, code: number, data: *, msg: string}}
 */
export const responseError = (msg = '', code = 500, data = '') => ({
  success: false,
  code,
  msg,
  data,
});
/**
 *
 * @param {*} data
 * @param msg
 * @param code
 * @returns {{success: boolean, code: number, data: *, msg: string}}
 */
export const responseSuccess = (data = '', msg = '成功', code = 200) => ({
  success: true,
  code,
  data,
  msg,
});

const throwResponseError = (msg = '', code = 500) => {
  throw responseError(msg, code);
};


